#!/bin/sh
## vim: set expandtab tabstop=4 shiftwidth=4:
##
##
## (c) 2009 by Mike Walsh
##
## @author Mike Walsh <mike_walsh@mindspring.com>
## @package sandbox-soccer
## @version $Revision$
## @lastmodified $Author$
## @lastmodifiedby $Date$
##
##
## Shell script to generate CSS color derivitives.  SuperFish
## menus are derived from the SuperFish source using a simple
## sed substitution of one color to another.  The theme CSS 
## files are generated similarly, starting from a baseline CSS
## file and replacing the placeholders with color values.
##
##

##  Generate SuperFish menus CSS files

SUPERFISH="../js/superfish-1.4.8"
SUPERFISHCSS="${SUPERFISH}/css/superfish.css"
SUPERFISHNAVBARCSS="${SUPERFISH}/css/superfish-navbar.css"

##  Superfish source Menu colors
##  #13a    - menu font color
##  #BDD2FF - menu color
##  #CFDEFF - hover color
##  #AABDE6 - sub-menu color
##  #D1DFFF - ? color
##  #E6EEFF - ? color
##  #9AAEDB - sub-sub-menu color
##  #fff    - border left color

##  Generate the "red" derivitive

sed -e 's/#13a/#FFFFFF/g' \
    -e 's/#BDD2FF/#800001/g' \
    -e 's/#CFDEFF/#F66802/g' \
    -e 's/#AABDE6/#F99802/g' \
    -e 's/#D1DFFF/#00FFFF/g' \
    -e 's/#E6EEFF/#FF00FF/g' \
    -e 's/#9AAEDB/#F99802/g' \
    -e 's/#fff/#F66802/g' \
    ${SUPERFISHCSS} > `basename ${SUPERFISHCSS} .css`-red.css

##  Superfish source Menu colors
##  #13a    - menu font color
##  #BDD2FF - menu color
##  #CFDEFF - hover color
##  #AABDE6 - sub-menu color
##  #D1DFFF - ? color
##  #E6EEFF - ? color
##  #9AAEDB - sub-sub-menu color
##  #fff    - border left color

##  Generate the "green" derivitive

sed -e 's/#13a/#FFFFFF/g' \
    -e 's/#BDD2FF/#008001/g' \
    -e 's/#CFDEFF/#88CC00/g' \
    -e 's/#AABDE6/#558000/g' \
    -e 's/#D1DFFF/#00FFFF/g' \
    -e 's/#E6EEFF/#FF00FF/g' \
    -e 's/#9AAEDB/#558000/g' \
    -e 's/#fff/#00F001/g' \
    ${SUPERFISHCSS} > `basename ${SUPERFISHCSS} .css`-green.css


##  Superfish source Menu colors
##  #13a    - menu font color
##  #BDD2FF - menu color
##  #CFDEFF - hover color
##  #AABDE6 - sub-menu color
##  #D1DFFF - ? color
##  #E6EEFF - ? color
##  #9AAEDB - sub-sub-menu color
##  #fff    - border left color

##  Generate the "blue" derivitive

sed -e 's/#13a/#FFFFFF/g' \
    -e 's/#BDD2FF/#000081/g' \
    -e 's/#CFDEFF/#FFF218/g' \
    -e 's/#AABDE6/#3E83A9/g' \
    -e 's/#D1DFFF/#00FFFF/g' \
    -e 's/#E6EEFF/#FF00FF/g' \
    -e 's/#9AAEDB/#3E83A9/g' \
    -e 's/#fff/#0000F1/g' \
    ${SUPERFISHCSS} > `basename ${SUPERFISHCSS} .css`-blue.css

##  Generate theme CSS files

SANDBOXSOCCERTHEMEBASELINECSS="sandbox-soccer-baseline.css"
SANDBOXSOCCERTHEMEREDCSS="sandbox-soccer-red.css"
SANDBOXSOCCERTHEMEGREENCSS="sandbox-soccer-green.css"
SANDBOXSOCCERTHEMEBLUECSS="sandbox-soccer-blue.css"

##  Generate the "red" CSS derivitive

sed -e 's/SANDBOX_SOCCER_THEME_BG_COLOR/#000000/g' \
    -e 's/SANDBOX_SOCCER_THEME_FG_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_DEFAULT_LINK_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_LINK_COLOR/#F66802/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BG_COLOR/#800001/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BORDER_COLOR/#F00001/g' \
    -e 's/SANDBOX_SOCCER_THEME_SUPERFISH_IE_FIX/#F66802/g' \
    ${SANDBOXSOCCERTHEMEBASELINECSS} > ${SANDBOXSOCCERTHEMEREDCSS}

##  Generate the "green" CSS derivitive

sed -e 's/SANDBOX_SOCCER_THEME_BG_COLOR/#000000/g' \
    -e 's/SANDBOX_SOCCER_THEME_FG_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_DEFAULT_LINK_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_LINK_COLOR/#88CC00/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BG_COLOR/#008001/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BORDER_COLOR/#00F001/g' \
    -e 's/SANDBOX_SOCCER_THEME_SUPERFISH_IE_FIX/#88CC00/g' \
    ${SANDBOXSOCCERTHEMEBASELINECSS} > ${SANDBOXSOCCERTHEMEGREENCSS}

##  Generate the "blue" CSS derivitive

sed -e 's/SANDBOX_SOCCER_THEME_BG_COLOR/#000000/g' \
    -e 's/SANDBOX_SOCCER_THEME_FG_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_DEFAULT_LINK_COLOR/#FFFFFF/g' \
    -e 's/SANDBOX_SOCCER_THEME_LINK_COLOR/#21B6E9/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BG_COLOR/#000081/g' \
    -e 's/SANDBOX_SOCCER_THEME_DIV_BORDER_COLOR/#0000F1/g' \
    -e 's/SANDBOX_SOCCER_THEME_SUPERFISH_IE_FIX/#21B6E9/g' \
    ${SANDBOXSOCCERTHEMEBASELINECSS} > ${SANDBOXSOCCERTHEMEBLUECSS}

